import { state } from "@/store/modules/asyncRoute/state"


// 与vue2的里面的data一样，函数返回新对象防止多处共用同一对象,造成数据混乱
export const searchFormSchema: FormSchema[] = []

export const getFormSchema = (): FormSchema => ({
    formItem: [
        {
            type: 'input',
            label: '字典值',
            field: 'value',
            value: '',
            props: {
                placeholder: '请输入字典值'
            },
            rules: [
                {
                    required: true,
                    message: '字典值不能为空'
                }
            ]
        },
        {
            type: 'input',
            label: '唯一编码',
            field: 'code',
            value: '',
            props: {
                placeholder: '请输入唯一编码'
            },
            rules: [
                {
                    required: true,
                    message: '唯一编码不能为空'
                }
            ]
        },
        {
            type: 'input',
            label: '扩展字段一',
            field: 'exta',
            value: '',
            props: {
                placeholder: '请输入扩展字段一'
            },
            rules: [
                {
                    required: true,
                    message: '扩展字段一不能为空'
                }
            ]
        },
        {
            type: 'input',
            label: '扩展字段二',
            field: 'extb',
            value: '',
            props: {
                placeholder: '请输入扩展字段二'
            },
            rules: [
                {
                    required: true,
                    message: '扩展字段二不能为空'
                }
            ]
        },
        {
            type: 'input',
            label: '扩展字段三',
            field: 'extc',
            value: '',
            props: {
                placeholder: '请输入扩展字段三'
            },
            rules: [
                {
                    required: true,
                    message: '扩展字段三不能为空'
                }
            ]
        },
        {
            type: 'input-number',
            label: '排序',
            field: 'sort',
            value: '',
            props: {
                placeholder: '请输入排序',
                max: 999999,
                min: 0
            },
            rules: [
                {
                    required: true,
                    message: '排序不能为空'
                }
            ]
        },
        {
            type: 'textarea',
            label: '备注',
            field: 'remark',
            value: '',
            props: {
                placeholder: '备注信息'
            }
        }
    ]
})
